#ifndef QSTRINGEDITDIALOG_H
#define QSTRINGEDITDIALOG_H

#include "corelibglobal.h"

#include <QDialog>
#include <QItemDelegate>
#include <QTreeWidget>
#include <QMap>

namespace Ui {
class QStringEditDialog;
}

namespace SHAREDLIB
{
    class QAbstractProperty;
    class tagLanguageItem;
}

namespace CORELIB
{

    class QLanguageDelegate: public QItemDelegate
    {
        Q_OBJECT
    public :
        QWidget* createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
        void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const;
        void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
        QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
    };


    class QStringEditDialog : public QDialog
    {
        Q_OBJECT
    public:
        explicit QStringEditDialog(SHAREDLIB::QAbstractProperty *property,QWidget* parent=0);
        ~QStringEditDialog();

    private slots:
        void on_enabled_clicked();

        void on_okBtn_clicked();

        void on_cancelBtn_clicked();

    protected:
        SHAREDLIB::QAbstractProperty        *m_property;
        QMap<QTreeWidgetItem*,QObject*>     m_items;
        QString                             m_objectID;
    private:
        Ui::QStringEditDialog *ui;
    };

}
#endif // QSTRINGEDITDIALOG_H
